<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*, javax.servlet.http.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<%
Cookie[] cookies = request.getCookies();
if (cookies == null) { %>
No hay cookies<br  />
<li>
					<h2>Cuenta de Usuario</h2>
					<ul>
						<form id="form1" method="post" action="servlet/coreservlets.Listar">
							<label for="inputtext1">Login:</label>
							<input id="inputtext1" type="text" name="login" />
							<label for="inputtext2">Password:</label>
							<input id="inputtext2" type="password" name="password" />
							<input id="inputsubmit1" type="submit" name="boton" value="Entrar" />
			  	  		</form>
					</ul>
				</li>
<%} else if(cookies.length >= 1 ){ %>
Hay 1 cookie<br />
<% 
	boolean b = false;
	for (Cookie c : cookies){
		if(c.getName().equalsIgnoreCase("Cookie-eCultura-Indentification")){
			String[] s = c.getValue().split("-"); %>
			Bienvenido <%=s[3]%>
			<%
			b = true;
			break;
		}
	}
	if(!b){ %>
	<li>
					<h2>Cuenta de Usuario</h2>
					<ul>
						<form id="form1" method="post" action="servlet/coreservlets.Listar">
							<label for="inputtext1">Login:</label>
							<input id="inputtext1" type="text" name="login" />
							<label for="inputtext2">Password:</label>
							<input id="inputtext2" type="password" name="password" />
							<input id="inputsubmit1" type="submit" name="boton" value="Entrar" />
			  	  		</form>
					</ul>
				</li>
	<%}
} %>

</body>
</html>
